home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / Think Class Libraries / TP TCL->CW TCL v1.1.2.3 / UPI ƒ / Updated UPIs ƒ / AppleTalk.p < prev    next >
Encoding:
Text File  |  1996-02-07  |  27.6 KB  |  766 lines  |  [TEXT/CWIE]

  1. {
  2.      File:        AppleTalk.p
  3.       Contains:    AppleTalk Interfaces.
  4.       Version:    Technology:    System 7.5
  5.                  Package:    Universal Interfaces 2.1 in “MPW Latest” on ETO #18
  6.       Copyright:    © 1984-1995 by Apple Computer, Inc.
  7.                  All rights reserved.
  8.       Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  9.                  stack.  Include the file and version information (from above)
  10.                  in the problem description and send to:
  11.                      Internet:    apple.bugs@applelink.apple.com
  12.                      AppleLink:    APPLE.BUGS
  13. }
  14.  
  15. {$IFC UNDEFINED UsingIncludes}
  16.     {$SETC UsingIncludes := 0}
  17. {$ENDC}
  18.  
  19. {$IFC NOT UsingIncludes}
  20.     UNIT AppleTalk;
  21.  
  22.     INTERFACE
  23. {$ENDC}
  24.  
  25. {$IFC UNDEFINED __APPLETALK__}
  26.     {$SETC __APPLETALK__ := 1}
  27.  
  28.     {$I+}
  29.     {$SETC AppleTalkIncludes := UsingIncludes}
  30.     {$SETC UsingIncludes := 1}
  31.  
  32.     {$IFC UNDEFINED __TYPES__}
  33.         {$I Types.p}
  34.     {$ENDC}
  35.  
  36.     (* ConditionalMacros.p *)
  37.  
  38.     {$IFC UNDEFINED __OSUTILS__}
  39.         {$I OSUtils.p}
  40.     {$ENDC}
  41.  
  42.     { MixedMode.p }
  43.     { Memory.p }
  44.  
  45.     {$PUSH}
  46.     {$ALIGN MAC68K}
  47.     {$LibExport+}
  48.  
  49.     CONST
  50.         { Driver unit and reference numbers (ADSP is dynamic) }
  51.         mppUnitNum                    = 9;                            { MPP unit number }
  52.         atpUnitNum                    = 10;                            { ATP unit number }
  53.         xppUnitNum                    = 40;                            { XPP unit number }
  54.         mppRefNum                    = -10;                            { MPP reference number }
  55.         atpRefNum                    = -11;                            { ATP reference number }
  56.         xppRefNum                    = -41;                            { XPP reference number }
  57.  
  58.         { .MPP csCodes }
  59.         lookupReply                    = 242;                            { This command queued to ourself }
  60.         writeLAP                    = 243;                            { Write out LAP packet }
  61.         detachPH                    = 244;                            { Detach LAP protocol handler }
  62.         attachPH                    = 245;                            { Attach LAP protocol handler }
  63.         writeDDP                    = 246;                            { Write out DDP packet }
  64.         closeSkt                    = 247;                            { Close DDP socket }
  65.         openSkt                        = 248;                            { Open DDP socket }
  66.         loadNBP                        = 249;                            { Load NBP command-executing code }
  67.         lastResident                = 249;                            { Last resident command }
  68.         confirmName                    = 250;                            { Confirm name }
  69.         lookupName                    = 251;                            { Look up name on internet }
  70.         removeName                    = 252;                            { Remove name from Names Table }
  71.         registerName                = 253;                            { Register name in Names Table }
  72.         killNBP                        = 254;                            { Kill outstanding NBP request }
  73.  
  74.         unloadNBP                    = 255;                            { Unload NBP command code }
  75.         setSelfSend                    = 256;                            { MPP: Set to allow writes to self }
  76.         SetMyZone                    = 257;                            { Set my zone name }
  77.         GetATalkInfo                = 258;                            { get AppleTalk information }
  78.         ATalkClosePrep                = 259;                            { AppleTalk close query }
  79.  
  80.         { .ATP csCodes }
  81.         nSendRequest                = 248;                            { NSendRequest code }
  82.         relRspCB                    = 249;                            { Release RspCB }
  83.         closeATPSkt                    = 250;                            { Close ATP socket }
  84.         addResponse                    = 251;                            { Add response code | Require open skt }
  85.         sendResponse                = 252;                            { Send response code }
  86.         getRequest                    = 253;                            { Get request code }
  87.         openATPSkt                    = 254;                            { Open ATP socket }
  88.         sendRequest                    = 255;                            { Send request code }
  89.         relTCB                        = 256;                            { Release TCB }
  90.         killGetReq                    = 257;                            { Kill GetRequest }
  91.         killSendReq                    = 258;                            { Kill SendRequest }
  92.         killAllGetReq                = 259;                            { Kill all getRequests for a skt }
  93.     
  94.         { .XPP csCodes }
  95.         openSess                    = 255;                            { Open session }
  96.         closeSess                    = 254;                            { Close session }
  97.         userCommand                    = 253;                            { User command }
  98.     
  99.         userWrite                    = 252;                            { User write }
  100.         getStatus                    = 251;                            { Get status }
  101.         afpCall                        = 250;                            { AFP command (buffer has command code) }
  102.         getParms                    = 249;                            { Get parameters }
  103.         abortOS                        = 248;                            { Abort open session request }
  104.         closeAll                    = 247;                            { Close all open sessions }
  105.         xCall                        = 246;                            { .XPP extended calls }
  106.     
  107.         { Transition Queue transition types }
  108.         ATTransOpen                    = 0;                            {AppleTalk has opened}
  109.         ATTransClose                = 2;                            {AppleTalk is about to close}
  110.         ATTransClosePrep            = 3;                            {Is it OK to close AppleTalk ?}
  111.         ATTransCancelClose            = 4;                            {Cancel the ClosePrep transition}
  112.         afpByteRangeLock            = 1;                            {AFPCall command codes}
  113.         afpVolClose                    = 2;                            {AFPCall command codes}
  114.         afpDirClose                    = 3;                            {AFPCall command codes}
  115.         afpForkClose                = 4;                            {AFPCall command codes}
  116.         afpCopyFile                    = 5;                            {AFPCall command codes}
  117.         afpDirCreate                = 6;                            {AFPCall command codes}
  118.         afpFileCreate                = 7;                            {AFPCall command codes}
  119.         afpDelete                    = 8;                            {AFPCall command codes}
  120.         afpEnumerate                = 9;                            {AFPCall command codes}
  121.     
  122.         afpFlush                    = 10;                            {AFPCall command codes}
  123.         afpForkFlush                = 11;                            {AFPCall command codes}
  124.         afpGetDirParms                = 12;                            {AFPCall command codes}
  125.         afpGetFileParms                = 13;                            {AFPCall command codes}
  126.         afpGetForkParms                = 14;                            {AFPCall command codes}
  127.         afpGetSInfo                    = 15;                            {AFPCall command codes}
  128.         afpGetSParms                = 16;                            {AFPCall command codes}
  129.         afpGetVolParms                = 17;                            {AFPCall command codes}
  130.         afpLogin                    = 18;                            {AFPCall command codes}
  131.         afpContLogin                = 19;                            {AFPCall command codes}
  132.         afpLogout                    = 20;                            {AFPCall command codes}
  133.         afpMapID                    = 21;                            {AFPCall command codes}
  134.         afpMapName                    = 22;                            {AFPCall command codes}
  135.         afpMove                        = 23;                            {AFPCall command codes}
  136.         afpOpenVol                    = 24;                            {AFPCall command codes}
  137.         afpOpenDir                    = 25;                            {AFPCall command codes}
  138.         afpOpenFork                    = 26;                            {AFPCall command codes}
  139.         afpRead                        = 27;                            {AFPCall command codes}
  140.         afpRename                    = 28;                            {AFPCall command codes}
  141.         afpSetDirParms                = 29;                            {AFPCall command codes}
  142.     
  143.         afpSetFileParms                = 30;                            {AFPCall command codes}
  144.         afpSetForkParms                = 31;                            {AFPCall command codes}
  145.         afpSetVolParms                = 32;                            {AFPCall command codes}
  146.         afpWrite                    = 33;                            {AFPCall command codes}
  147.         afpGetFlDrParms                = 34;                            {AFPCall command codes}
  148.         afpSetFlDrParms                = 35;                            {AFPCall command codes}
  149.         afpDTOpen                    = 48;                            {AFPCall command codes}
  150.         afpDTClose                    = 49;                            {AFPCall command codes}
  151.         afpGetIcon                    = 51;                            {AFPCall command codes}
  152.         afpGtIcnInfo                = 52;                            {AFPCall command codes}
  153.         afpAddAPPL                    = 53;                            {AFPCall command codes}
  154.         afpRmvAPPL                    = 54;                            {AFPCall command codes}
  155.         afpGetAPPL                    = 55;                            {AFPCall command codes}
  156.         afpAddCmt                    = 56;                            {AFPCall command codes}
  157.         afpRmvCmt                    = 57;                            {AFPCall command codes}
  158.         afpGetCmt                    = 58;                            {AFPCall command codes}
  159.         afpAddIcon                    = 192;                            {Special code for ASP Write commands}
  160.         xppLoadedBit                = 5;                            { XPP bit in PortBUse }
  161.         scbMemSize                    = 192;                            { Size of memory for SCB }
  162.         xppFlagClr                    = 0;                            { Cs for AFPCommandBlock }
  163.     
  164.         xppFlagSet                    = 128;                            { StartEndFlag & NewLineFlag fields. }
  165.         lapSize                        = 20;
  166.         ddpSize                        = 26;
  167.         nbpSize                        = 26;
  168.         atpSize                        = 56;
  169.         atpXOvalue                    = 32;                            {ATP exactly-once bit }
  170.         atpEOMvalue                    = 16;                            {ATP End-Of-Message bit }
  171.         atpSTSvalue                    = 8;                            {ATP Send-Transmission-Status bit }
  172.         atpTIDValidvalue            = 2;                            {ATP trans. ID valid bit }
  173.         atpSendChkvalue                = 1;                            {ATP send checksum bit }
  174.         zipGetLocalZones            = 5;
  175.         zipGetZoneList                = 6;
  176.         zipGetMyZone                = 7;
  177.         LAPMgrPtr                    = $B18;                            {Entry point for LAP Manager}
  178.         LAPMgrCall                    = 2;                            {Offset to LAP routines}
  179.         LAddAEQ                        = 23;                            {LAPAddATQ routine selector}
  180.         LRmvAEQ                        = 24;                            {LAPRmvATQ routine selector}
  181.     
  182.         tLAPRead                    = 0;
  183.         tLAPWrite                    = 1;
  184.         tDDPRead                    = 2;
  185.         tDDPWrite                    = 3;
  186.         tNBPLookup                    = 4;
  187.         tNBPConfirm                    = 5;
  188.         tNBPRegister                = 6;
  189.         tATPSndRequest                = 7;
  190.         tATPGetRequest                = 8;
  191.         tATPSdRsp                    = 9;
  192.         tATPAddRsp                    = 10;
  193.         tATPRequest                    = 11;
  194.         tATPResponse                = 12;
  195.  
  196.     TYPE
  197.         ABCallType = SInt8;
  198.  
  199.     CONST
  200.         lapProto                    = 0;
  201.         ddpProto                    = 1;
  202.         nbpProto                    = 2;
  203.         atpProto                    = 3;
  204.  
  205.     TYPE
  206.         ABProtoType = UInt8;
  207.         ABByte = Byte;
  208.     
  209.         LAPAdrBlock = PACKED RECORD
  210.             dstNodeID:                UInt8;
  211.             srcNodeID:                UInt8;
  212.             lapProtType:            ABByte;
  213.             filler:                    UInt8;                                { Filler for proper byte alignment }
  214.         END;
  215.     
  216.         ATalkTransitionEventUPP = UniversalProcPtr;
  217.         ATalkTransitionEvent = ATalkTransitionEventUPP;
  218.  
  219.         ATQEntry = RECORD
  220.             qLink:                    ^ATQEntry;                                {next queue entry}
  221.             qType:                    INTEGER;                                {queue type}
  222.             CallAddr:                ATalkTransitionEventUPP;                {your routine descriptor}
  223.         END;
  224.         ATQEntryPtr = ^ATQEntry;
  225.     
  226.     {$IFC MWERKS & PROCTYPE}
  227.         ATalkTransitionEventProcPtr = FUNCTION (eventCode: LONGINT; qElem: ATQEntryPtr; eventParameter: UNIV Ptr): LONGINT;
  228.     {$ELSEC}
  229.         ATalkTransitionEventProcPtr = ProcPtr;  { FUNCTION ATalkTransitionEvent(eventCode: LONGINT; qElem: ATQEntryPtr; eventParameter: UNIV Ptr): LONGINT; }
  230.     {$ENDC}
  231.  
  232.         AddrBlock = PACKED RECORD
  233.             aNet:                    UInt16;
  234.             aNode:                    UInt8;
  235.             aSocket:                UInt8;
  236.         END;
  237.  
  238.         { Real definition of EntityName is 3 PACKED strings of any length (32 is just an example). No
  239.           offests for Asm since each String address must be calculated by adding length byte  to last
  240.           string ptr. In Pascal, String(32) will be 34 bytes long since fields never start on an  odd
  241.           byte unless they are only a byte long. So this will generate correct looking interfaces for
  242.           Pascal and C, but they will not be the same, which is OK since they are not used. }
  243.         EntityName = RECORD
  244.             objStr:                    Str32;
  245.             typeStr:                Str32;
  246.             zoneStr:                Str32;
  247.         END;
  248.         EntityPtr = ^EntityName;
  249.  
  250.         RetransType = PACKED RECORD
  251.             retransInterval:        UInt8;
  252.             retransCount:            UInt8;
  253.         END;
  254.     
  255.         BDSElement = RECORD
  256.             buffSize:                INTEGER;
  257.             buffPtr:                Ptr;
  258.             dataSize:                INTEGER;
  259.             userBytes:                LONGINT;
  260.         END;
  261.         BDSType = ARRAY [0..7] OF BDSElement;
  262.         BDSPtr = ^BDSElement;
  263.  
  264.         BitMapType = PACKED ARRAY [0..7] OF BOOLEAN;
  265.     
  266.         ATLAPRec = RECORD
  267.             abOpcode:                ABCallType;
  268.             filler:                    SInt8;                                    {    Filler for proper byte alignment}
  269.             abResult:                INTEGER;
  270.             abUserReference:        LONGINT;
  271.             lapAddress:                LAPAdrBlock;
  272.             lapReqCount:            INTEGER;
  273.             lapActCount:            INTEGER;
  274.             lapDataPtr:                Ptr;
  275.         END;
  276.         ATLAPRecPtr = ^ATLAPRec;
  277.         ATLAPRecHandle = ^ATLAPRecPtr;
  278.     
  279.         ATDDPRec = RECORD
  280.             abOpcode:                ABCallType;
  281.             filler:                    SInt8;                                    {    Filler for proper byte alignment}
  282.             abResult:                INTEGER;
  283.             abUserReference:        LONGINT;
  284.             ddpType:                INTEGER;
  285.             ddpSocket:                INTEGER;
  286.             ddpAddress:                AddrBlock;
  287.             ddpReqCount:            INTEGER;
  288.             ddpActCount:            INTEGER;
  289.             ddpDataPtr:                Ptr;
  290.             ddpNodeID:                INTEGER;
  291.         END;
  292.         ATDDPRecPtr = ^ATDDPRec;
  293.         ATDDPRecHandle = ^ATDDPRecPtr;
  294.  
  295.         ATNBPRec = RECORD
  296.             abOpcode:                ABCallType;
  297.             filler:                    SInt8;                                    {    Filler for proper byte alignment}
  298.             abResult:                INTEGER;
  299.             abUserReference:        LONGINT;
  300.             nbpEntityPtr:            EntityPtr;
  301.             nbpBufPtr:                Ptr;
  302.             nbpBufSize:                INTEGER;
  303.             nbpDataField:            INTEGER;
  304.             nbpAddress:                AddrBlock;
  305.             nbpRetransmitInfo:        RetransType;
  306.         END;
  307.         ATNBPRecPtr = ^ATNBPRec;
  308.         ATNBPRecHandle = ^ATNBPRecPtr;
  309.  
  310.         ATATPRec = RECORD
  311.             abOpcode:                ABCallType;
  312.             filler1:                SInt8;                                    {    Filler for proper byte alignment}
  313.             abResult:                INTEGER;
  314.             abUserReference:        LONGINT;
  315.             atpSocket:                INTEGER;
  316.             atpAddress:                AddrBlock;
  317.             atpReqCount:            INTEGER;
  318.             atpDataPtr:                Ptr;
  319.             atpRspBDSPtr:            BDSPtr;
  320.             atpBitMap:                BitMapType;
  321.             filler2:                SInt8; (* UInt8 *)                        {    Filler for proper byte alignment}
  322.             atpTransID:                INTEGER;
  323.             atpActCount:            INTEGER;
  324.             atpUserData:            LONGINT;
  325.             atpXO:                    BOOLEAN;
  326.             atpEOM:                    BOOLEAN;
  327.             atpTimeOut:                INTEGER;
  328.             atpRetries:                INTEGER;
  329.             atpNumBufs:                INTEGER;
  330.             atpNumRsp:                INTEGER;
  331.             atpBDSSize:                INTEGER;
  332.             atpRspUData:            LONGINT;
  333.             atpRspBuf:                Ptr;
  334.             atpRspSize:                INTEGER;
  335.         END;
  336.         ATATPRecPtr = ^ATATPRec;
  337.         ATATPRecHandle = ^ATATPRecPtr;
  338.     
  339.         AFPCommandBlock = PACKED RECORD
  340.             cmdByte:                UInt8;
  341.             startEndFlag:            UInt8;
  342.             forkRefNum:                INTEGER;
  343.             rwOffset:                LONGINT;
  344.             reqCount:                LONGINT;
  345.             newLineFlag:            UInt8;
  346.             newLineChar:            CHAR;
  347.         END;
  348.     
  349.         MPPPBPtr = ^MPPParamBlock;
  350.         ATPPBPtr = ^ATPParamBlock;
  351.         XPPParmBlkPtr = ^XPPParamBlock;
  352.  
  353.         { MPPCompletionProcPtr uses register based parameters on the 68k and cannot be written in or
  354.           called from a high-level language without the help of mixed mode or assembly glue.
  355.              => thePBptr        A0.L }
  356.         MPPCompletionProcPtr = Register68kProcPtr;  { register PROCEDURE (thePBptr: MPPPBPtr); }
  357.         MPPCompletionUPP = UniversalProcPtr;
  358.     
  359.         { ATPCompletionProcPtr uses register based parameters on the 68k and cannot be written in or
  360.           called from a high-level language without the help of mixed mode or assembly glue.
  361.              => thePBptr        A0.L }
  362.         ATPCompletionProcPtr = Register68kProcPtr;  { register PROCEDURE (thePBptr: ATPPBPtr); }
  363.         ATPCompletionUPP = UniversalProcPtr;
  364.     
  365.         { XPPCompletionProcPtr uses register based parameters on the 68k and cannot be written in or 
  366.           called from a high-level language without the help of mixed mode or assembly glue.
  367.              => thePBptr        A0.L }
  368.         XPPCompletionProcPtr = Register68kProcPtr;  { register PROCEDURE (thePBptr: XPPParmBlkPtr); }
  369.         XPPCompletionUPP = UniversalProcPtr;
  370.     
  371.         { AttnRoutineProcPtr uses register based parameters on the 68k and cannot be written in or 
  372.           called from a high-level language without the help of mixed mode or assembly glue.
  373.              => sessRefnum      D0.W
  374.              => attnBytes       D1.W }
  375.         AttnRoutineProcPtr = Register68kProcPtr;  { register PROCEDURE (sessRefnum: INTEGER; attnBytes: INTEGER); }
  376.         AttnRoutineUPP = UniversalProcPtr;
  377.  
  378.         WDSElement = RECORD
  379.             entryLength:            INTEGER;
  380.             entryPtr:                Ptr;
  381.         END;
  382.  
  383.         NTElement = RECORD
  384.             nteAddress:                AddrBlock;                                {network address of entity}
  385.             filler:                    SInt8;
  386.             entityData:                PACKED ARRAY [0..98] OF SInt8;            {Object, Type & Zone}
  387.         END;
  388.     
  389.         NamesTableEntry = RECORD
  390.             qNext:                    Ptr;                                    {ptr to next NTE}
  391.             nt:                        NTElement;
  392.         END;
  393.  
  394.     {$IFC MWERKS & PROCTYPE}
  395.         MPPProtocolHandlerProcPtr = FUNCTION (SCCAddr1: Ptr; SCCAddr2: Ptr; MPPLocalVars: Ptr; nextFreeByteInRHA: Ptr; ReadPacketAndReadRestPtr: Ptr; numBytesLeftToReadInPacket: INTEGER): BOOLEAN; 
  396.         DDPSocketListenerProcPtr = FUNCTION (SCCAddr1: Ptr; SCCAddr2: Ptr; MPPLocalVars: Ptr; nextFreeByteInRHA: Ptr; ReadPacketAndReadRestPtr: Ptr; packetDestinationNumber: ByteParameter; numBytesLeftToReadInPacket: INTEGER): BOOLEAN; 
  397.     {$ELSEC}
  398.         MPPProtocolHandlerProcPtr = ProcPtr;  { FUNCTION MPPProtocolHandler(SCCAddr1: Ptr; SCCAddr2: Ptr; MPPLocalVars: Ptr; nextFreeByteInRHA: Ptr; ReadPacketAndReadRestPtr: Ptr; numBytesLeftToReadInPacket: INTEGER): BOOLEAN; }
  399.         DDPSocketListenerProcPtr = ProcPtr;  { FUNCTION DDPSocketListener(SCCAddr1: Ptr; SCCAddr2: Ptr; MPPLocalVars: Ptr; nextFreeByteInRHA: Ptr; ReadPacketAndReadRestPtr: Ptr; packetDestinationNumber: ByteParameter; numBytesLeftToReadInPacket: INTEGER): BOOLEAN; }
  400.     {$ENDC}
  401.     
  402.         MPPProtocolHandlerUPP = UniversalProcPtr;
  403.         DDPSocketListenerUPP = UniversalProcPtr;
  404.  
  405.         MPPParamBlock = PACKED RECORD
  406.             qLink:                    ^QElem;
  407.             qType:                    INTEGER;
  408.             ioTrap:                    INTEGER;
  409.             ioCmdAddr:                Ptr;
  410.             ioCompletion:            ATPCompletionUPP;
  411.             ioResult:                OSErr;
  412.             userData:                LONGINT;
  413.             reqTID:                    INTEGER;
  414.             ioRefNum:                INTEGER;
  415.             csCode:                    INTEGER;
  416.             CASE INTEGER OF
  417.             0: (
  418.                 filler0:                    INTEGER;
  419.                 wdsPointer:                    Ptr;
  420.                );
  421.             1: (
  422.                 protType:                    UInt8;
  423.                 filler:                        UInt8;
  424.                 handler:                    MPPProtocolHandlerUPP;
  425.                );
  426.             2: (
  427.                 socket:                        UInt8;
  428.                 checksumFlag:                UInt8;
  429.                 listener:                    DDPSocketListenerUPP;
  430.                );
  431.             3: (
  432.                 interval:                    SInt8; (* UInt8 *)                    {retry interval }
  433.                 count:                        SInt8; (* UInt8 *)                    {retry count }
  434.                 nbpPtrs:                    Ptr;
  435.                 CASE INTEGER OF
  436.                 0: (
  437.                     verifyFlag:                        SInt8; (* UInt8 *)
  438.                     filler3:                        SInt8; (* UInt8 *)
  439.                    );
  440.                 1: (
  441.                     retBuffPtr:                        Ptr;
  442.                     retBuffSize:                    INTEGER;
  443.                     maxToGet:                        INTEGER;
  444.                     numGotten:                        INTEGER;
  445.                    );
  446.                 2: (
  447.                     confirmAddr:                    AddrBlock;
  448.                     newSocket:                        SInt8; (* UInt8 *)
  449.                     filler4:                        SInt8; (* UInt8 *)
  450.                    );
  451.                );
  452.             4: (
  453.                 newSelfFlag:                UInt8;                                {self-send toggle flag }
  454.                 oldSelfFlag:                UInt8;                                {previous self-send state }
  455.                );
  456.             5: (
  457.                 nKillQEl:                    Ptr;                                {ptr to i/o queue element to cancel }
  458.                );
  459.             6: (
  460.                 version:                    INTEGER;
  461.                 varsPtr:                    Ptr;
  462.                 DCEPtr:                        Ptr;
  463.                 portID:                        INTEGER;
  464.                 configuration:                LONGINT;
  465.                 selfSend:                    INTEGER;
  466.                 netLo:                        INTEGER;
  467.                 netHi:                        INTEGER;
  468.                 ourAdd:                        LONGINT;
  469.                 routerAddr:                    LONGINT;
  470.                 numOfPHs:                    INTEGER;
  471.                 numOfSkts:                    INTEGER;
  472.                 numNBPEs:                    INTEGER;
  473.                 nTQueue:                    Ptr;
  474.                 LAlength:                    INTEGER;
  475.                 linkAddr:                    Ptr;
  476.                 zoneName:                    Ptr;
  477.                );
  478.             7: (
  479.                 appName:                    Ptr;                                {pointer to application name in buffer}
  480.                );
  481.         END;
  482.     
  483.         XPPParamBlock = PACKED RECORD
  484.             qLink:                    ^QElem;
  485.             qType:                    INTEGER;
  486.             ioTrap:                    INTEGER;
  487.             ioCmdAddr:                Ptr;
  488.             ioCompletion:            XPPCompletionUPP;
  489.             ioResult:                OSErr;
  490.             cmdResult:                LONGINT;
  491.             ioVRefNum:                INTEGER;
  492.             ioRefNum:                INTEGER;
  493.             csCode:                    INTEGER;
  494.             CASE INTEGER OF
  495.             0: (
  496.                 abortSCBPtr:                Ptr;                                { SCB pointer for AbortOS}
  497.                );
  498.             1: (
  499.                 aspMaxCmdSize:                INTEGER;
  500.                 aspQuantumSize:                INTEGER;
  501.                 numSesss:                    INTEGER;
  502.                );
  503.             2: (
  504.                 sessRefnum:                    INTEGER;
  505.                 aspTimeout:                    SInt8; (* UInt8 *)
  506.                 aspRetry:                    SInt8; (* UInt8 *)
  507.                 CASE INTEGER OF
  508.                 0: (
  509.                     serverAddr:                        AddrBlock;
  510.                     scbPointer:                        Ptr;
  511.                     attnRoutine:                    AttnRoutineUPP;
  512.                    );
  513.                 1: (
  514.                     cbSize:                            INTEGER;
  515.                     cbPtr:                            Ptr;
  516.                     rbSize:                            INTEGER;
  517.                     rbPtr:                            Ptr;
  518.                     CASE INTEGER OF
  519.                     0: (
  520.                         afpAddrBlock:                        AddrBlock;
  521.                         afpSCBPtr:                            Ptr;
  522.                         afpAttnRoutine:                        Ptr;
  523.                        );
  524.                     1: (
  525.                         wdSize:                                INTEGER;
  526.                         wdPtr:                                Ptr;
  527.                         ccbStart:                            ARRAY [0..295] OF SInt8; (* UInt8 *)
  528.                        );
  529.                    );
  530.                );
  531.             3: (
  532.                 xppSubCode:                    INTEGER;
  533.                 xppTimeout:                    UInt8;
  534.                 xppRetry:                    UInt8;
  535.                 filler1:                    INTEGER;
  536.                 zipBuffPtr:                    Ptr;
  537.                 zipNumZones:                INTEGER;
  538.                 zipLastFlag:                UInt8;
  539.                 filler2:                    UInt8;
  540.                 zipInfoField:                PACKED ARRAY [1..70] OF UInt8;
  541.                );
  542.         END;
  543.     
  544.         ATPParamBlock = PACKED RECORD
  545.             qLink:                    ^QElem;
  546.             qType:                    INTEGER;
  547.             ioTrap:                    INTEGER;
  548.             ioCmdAddr:                Ptr;
  549.             ioCompletion:            ATPCompletionUPP;
  550.             ioResult:                OSErr;
  551.             userData:                LONGINT;
  552.             reqTID:                    INTEGER;
  553.             ioRefNum:                INTEGER;
  554.             csCode:                    INTEGER;
  555.             atpSocket:                UInt8;
  556.             atpFlags:                UInt8;
  557.             addrBlock:                AddrBlock;
  558.             reqLength:                INTEGER;
  559.             reqPointer:                Ptr;
  560.             bdsPointer:                Ptr;
  561.             CASE INTEGER OF
  562.             0: (
  563.                 numOfBuffs:                    UInt8;
  564.                 timeOutVal:                    UInt8;
  565.                 numOfResps:                    UInt8;
  566.                 retryCount:                    UInt8;
  567.                 intBuff:                    INTEGER;
  568.                 TRelTime:                    UInt8;
  569.                );
  570.             1: (
  571.                 filler:                        UInt8;
  572.                 bdsSize:                    UInt8;
  573.                 transID:                    INTEGER;
  574.                );
  575.             2: (
  576.                 bitMap:                        UInt8;
  577.                 filler2:                    UInt8;
  578.                );
  579.             3: (
  580.                 rspNum:                        UInt8;
  581.                 filler3:                    UInt8;
  582.                );
  583.             4: (
  584.                 aKillQEl:                    Ptr;
  585.                );
  586.         END;
  587.  
  588.     CONST
  589.         uppATalkTransitionEventProcInfo = $00000FF1; { FUNCTION (4 byte param, 4 byte param, 4 byte param): 4 byte result; }
  590.         uppMPPCompletionProcInfo = $00009802; { Register PROCEDURE (4 bytes in A0); }
  591.         uppATPCompletionProcInfo = $00009802; { Register PROCEDURE (4 bytes in A0); }
  592.         uppXPPCompletionProcInfo = $00009802; { Register PROCEDURE (4 bytes in A0); }
  593.         uppAttnRoutineProcInfo = $00061002; { Register PROCEDURE (2 bytes in D0, 2 bytes in D1); }
  594.         uppMPPProtocolHandlerProcInfo = $0000007F; { SPECIAL_CASE_PROCINFO( kSpecialCaseProtocolHandler ) }
  595.         uppDDPSocketListenerProcInfo = $0000008F; { SPECIAL_CASE_PROCINFO( kSpecialCaseSocketListener ) }
  596.     
  597.     FUNCTION NewATalkTransitionEventProc(userRoutine: ATalkTransitionEventProcPtr): ATalkTransitionEventUPP;
  598.         {$IFC NOT GENERATINGCFM }
  599.         INLINE $2E9F;
  600.         {$ENDC}
  601.     
  602.     FUNCTION NewMPPCompletionProc(userRoutine: MPPCompletionProcPtr): MPPCompletionUPP;
  603.         {$IFC NOT GENERATINGCFM }
  604.         INLINE $2E9F;
  605.         {$ENDC}
  606.     
  607.     FUNCTION NewATPCompletionProc(userRoutine: ATPCompletionProcPtr): ATPCompletionUPP;
  608.         {$IFC NOT GENERATINGCFM }
  609.         INLINE $2E9F;
  610.         {$ENDC}
  611.     
  612.     FUNCTION NewXPPCompletionProc(userRoutine: XPPCompletionProcPtr): XPPCompletionUPP;
  613.         {$IFC NOT GENERATINGCFM }
  614.         INLINE $2E9F;
  615.         {$ENDC}
  616.     
  617.     FUNCTION NewAttnRoutineProc(userRoutine: AttnRoutineProcPtr): AttnRoutineUPP;
  618.         {$IFC NOT GENERATINGCFM }
  619.         INLINE $2E9F;
  620.         {$ENDC}
  621.     
  622.     FUNCTION NewMPPProtocolHandlerProc(userRoutine: MPPProtocolHandlerProcPtr): MPPProtocolHandlerUPP;
  623.         {$IFC NOT GENERATINGCFM }
  624.         INLINE $2E9F;
  625.         {$ENDC}
  626.     
  627.     FUNCTION NewDDPSocketListenerProc(userRoutine: DDPSocketListenerProcPtr): DDPSocketListenerUPP;
  628.         {$IFC NOT GENERATINGCFM }
  629.         INLINE $2E9F;
  630.         {$ENDC}
  631.     
  632.     FUNCTION CallATalkTransitionEventProc(eventCode: LONGINT; qElem: ATQEntryPtr; eventParameter: UNIV Ptr; userRoutine: ATalkTransitionEventUPP): LONGINT;
  633.         {$IFC NOT GENERATINGCFM}
  634.         INLINE $205F, $4E90;
  635.         {$ENDC}
  636.     
  637.     PROCEDURE CallMPPCompletionProc(thePBptr: MPPPBPtr; userRoutine: MPPCompletionUPP);
  638.         {$IFC NOT GENERATINGCFM}
  639.         {To be implemented:  Glue to move parameters into registers.}
  640.         {$ENDC}
  641.     
  642.     PROCEDURE CallATPCompletionProc(thePBptr: ATPPBPtr; userRoutine: ATPCompletionUPP);
  643.         {$IFC NOT GENERATINGCFM}
  644.         {To be implemented:  Glue to move parameters into registers.}
  645.         {$ENDC}
  646.     
  647.     PROCEDURE CallXPPCompletionProc(thePBptr: XPPParmBlkPtr; userRoutine: XPPCompletionUPP);
  648.         {$IFC NOT GENERATINGCFM}
  649.         {To be implemented:  Glue to move parameters into registers.}
  650.         {$ENDC}
  651.     
  652.     PROCEDURE CallAttnRoutineProc(sessRefnum: INTEGER; attnBytes: INTEGER; userRoutine: AttnRoutineUPP);
  653.         {$IFC NOT GENERATINGCFM}
  654.         {To be implemented:  Glue to move parameters into registers.}
  655.         {$ENDC}
  656.     
  657.     FUNCTION CallMPPProtocolHandlerProc(SCCAddr1: Ptr; SCCAddr2: Ptr; MPPLocalVars: Ptr; nextFreeByteInRHA: Ptr; ReadPacketAndReadRestPtr: Ptr; numBytesLeftToReadInPacket: INTEGER; userRoutine: MPPProtocolHandlerUPP): BOOLEAN;
  658.         {$IFC NOT GENERATINGCFM}
  659.         {To be implemented:  Glue to move parameters according to special case conventions.}
  660.         {$ENDC}
  661.     
  662.     FUNCTION CallDDPSocketListenerProc(SCCAddr1: Ptr; SCCAddr2: Ptr; MPPLocalVars: Ptr; nextFreeByteInRHA: Ptr; ReadPacketAndReadRestPtr: Ptr; packetDestinationNumber: ByteParameter; numBytesLeftToReadInPacket: INTEGER; userRoutine: DDPSocketListenerUPP): BOOLEAN;
  663.         {$IFC NOT GENERATINGCFM}
  664.         {To be implemented:  Glue to move parameters according to special case conventions.}
  665.         {$ENDC}
  666.     
  667.     FUNCTION OpenXPP(VAR xppRefnum: INTEGER): OSErr;
  668.     FUNCTION ASPOpenSession(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  669.     FUNCTION ASPCloseSession(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  670.     FUNCTION ASPAbortOS(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  671.     FUNCTION ASPGetParms(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  672.     FUNCTION ASPCloseAll(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  673.     FUNCTION ASPUserWrite(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  674.     FUNCTION ASPUserCommand(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  675.     FUNCTION ASPGetStatus(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  676.     FUNCTION AFPCommand(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  677.     FUNCTION GetLocalZones(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  678.     FUNCTION GetZoneList(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  679.     FUNCTION GetMyZone(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  680.     FUNCTION PAttachPH(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  681.     FUNCTION PDetachPH(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  682.     FUNCTION PWriteLAP(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  683.     FUNCTION POpenSkt(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  684.     FUNCTION PCloseSkt(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  685.     FUNCTION PWriteDDP(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  686.     FUNCTION PRegisterName(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  687.     FUNCTION PLookupName(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  688.     FUNCTION PConfirmName(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  689.     FUNCTION PRemoveName(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  690.     FUNCTION PSetSelfSend(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  691.     FUNCTION PKillNBP(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  692.     FUNCTION PGetAppleTalkInfo(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  693.     FUNCTION PATalkClosePrep(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  694.     FUNCTION POpenATPSkt(thePBptr: ATPPBPtr; async: BOOLEAN): OSErr;
  695.     FUNCTION PCloseATPSkt(thePBPtr: ATPPBPtr; async: BOOLEAN): OSErr;
  696.     FUNCTION PSendRequest(thePBPtr: ATPPBPtr; async: BOOLEAN): OSErr;
  697.     FUNCTION PGetRequest(thePBPtr: ATPPBPtr; async: BOOLEAN): OSErr;
  698.     FUNCTION PSendResponse(thePBPtr: ATPPBPtr; async: BOOLEAN): OSErr;
  699.     FUNCTION PAddResponse(thePBPtr: ATPPBPtr; async: BOOLEAN): OSErr;
  700.     FUNCTION PRelTCB(thePBPtr: ATPPBPtr; async: BOOLEAN): OSErr;
  701.     FUNCTION PRelRspCB(thePBPtr: ATPPBPtr; async: BOOLEAN): OSErr;
  702.     FUNCTION PNSendRequest(thePBPtr: ATPPBPtr; async: BOOLEAN): OSErr;
  703.     FUNCTION PKillSendReq(thePBPtr: ATPPBPtr; async: BOOLEAN): OSErr;
  704.     FUNCTION PKillGetReq(thePBPtr: ATPPBPtr; async: BOOLEAN): OSErr;
  705.     FUNCTION ATPKillAllGetReq(thePBPtr: ATPPBPtr; async: BOOLEAN): OSErr;
  706.     PROCEDURE BuildLAPwds(wdsPtr: Ptr; dataPtr: Ptr; destHost: INTEGER; prototype: INTEGER; frameLen: INTEGER);
  707.     PROCEDURE BuildDDPwds(wdsPtr: Ptr; headerPtr: Ptr; dataPtr: Ptr; netAddr: AddrBlock; ddpType: INTEGER; dataLen: INTEGER);
  708.     PROCEDURE NBPSetEntity(buffer: Ptr; nbpObject: ConstStr32Param; nbpType: ConstStr32Param; nbpZone: ConstStr32Param);
  709.     PROCEDURE NBPSetNTE(ntePtr: Ptr; nbpObject: ConstStr32Param; nbpType: ConstStr32Param; nbpZone: ConstStr32Param; socket: INTEGER);
  710.     FUNCTION GetBridgeAddress: INTEGER;
  711.     FUNCTION BuildBDS(buffPtr: Ptr; bdsPtr: Ptr; buffSize: INTEGER): INTEGER;
  712.     FUNCTION MPPOpen: OSErr;
  713.     FUNCTION LAPAddATQ(theATQEntry: ATQEntryPtr): OSErr;
  714.     FUNCTION LAPRmvATQ(theATQEntry: ATQEntryPtr): OSErr;
  715.     FUNCTION ATPLoad: OSErr;
  716.     FUNCTION ATPUnload: OSErr;
  717.     FUNCTION NBPExtract(theBuffer: Ptr; numInBuf: INTEGER; whichOne: INTEGER; VAR abEntity: EntityName; VAR address: AddrBlock): OSErr;
  718.     FUNCTION GetNodeAddress(VAR myNode: INTEGER; VAR myNet: INTEGER): OSErr;
  719.     FUNCTION IsMPPOpen: BOOLEAN;
  720.     FUNCTION IsATPOpen: BOOLEAN;
  721.     PROCEDURE ATEvent(event: LONGINT; infoPtr: Ptr);
  722.     FUNCTION ATPreFlightEvent(event: LONGINT; cancel: LONGINT; infoPtr: Ptr): OSErr;
  723.  
  724.     { The following routines are obsolete and will not be supported on PowerPC. Equivalent
  725.       functionality is provided by the routines above. }
  726.     {$IFC OLDROUTINENAMES  & NOT GENERATINGCFM }
  727.         FUNCTION MPPClose: OSErr;
  728.         FUNCTION LAPOpenProtocol(theLAPType: ByteParameter; protoPtr: Ptr): OSErr;
  729.         FUNCTION LAPCloseProtocol(theLAPType: ByteParameter): OSErr;
  730.         FUNCTION LAPWrite(abRecord: ATLAPRecHandle; async: BOOLEAN): OSErr;
  731.         FUNCTION LAPRead(abRecord: ATLAPRecHandle; async: BOOLEAN): OSErr;
  732.         FUNCTION LAPRdCancel(abRecord: ATLAPRecHandle): OSErr;
  733.         FUNCTION DDPOpenSocket(VAR theSocket: INTEGER; sktListener: Ptr): OSErr;
  734.         FUNCTION DDPCloseSocket(theSocket: INTEGER): OSErr;
  735.         FUNCTION DDPRead(abRecord: ATDDPRecHandle; retCksumErrs: BOOLEAN; async: BOOLEAN): OSErr;
  736.         FUNCTION DDPWrite(abRecord: ATDDPRecHandle; doChecksum: BOOLEAN; async: BOOLEAN): OSErr;
  737.         FUNCTION DDPRdCancel(abRecord: ATDDPRecHandle): OSErr;
  738.         FUNCTION ATPOpenSocket(addrRcvd: AddrBlock; VAR atpSocket: INTEGER): OSErr;
  739.         FUNCTION ATPCloseSocket(atpSocket: INTEGER): OSErr;
  740.         FUNCTION ATPSndRequest(abRecord: ATATPRecHandle; async: BOOLEAN): OSErr;
  741.         FUNCTION ATPRequest(abRecord: ATATPRecHandle; async: BOOLEAN): OSErr;
  742.         FUNCTION ATPReqCancel(abRecord: ATATPRecHandle; async: BOOLEAN): OSErr;
  743.         FUNCTION ATPGetRequest(abRecord: ATATPRecHandle; async: BOOLEAN): OSErr;
  744.         FUNCTION ATPSndRsp(abRecord: ATATPRecHandle; async: BOOLEAN): OSErr;
  745.         FUNCTION ATPAddRsp(abRecord: ATATPRecHandle): OSErr;
  746.         FUNCTION ATPResponse(abRecord: ATATPRecHandle; async: BOOLEAN): OSErr;
  747.         FUNCTION ATPRspCancel(abRecord: ATATPRecHandle; async: BOOLEAN): OSErr;
  748.         FUNCTION NBPRegister(abRecord: ATNBPRecHandle; async: BOOLEAN): OSErr;
  749.         FUNCTION NBPLookup(abRecord: ATNBPRecHandle; async: BOOLEAN): OSErr;
  750.         FUNCTION NBPConfirm(abRecord: ATNBPRecHandle; async: BOOLEAN): OSErr;
  751.         FUNCTION NBPRemove(abEntity: EntityPtr): OSErr;
  752.         FUNCTION NBPLoad: OSErr;
  753.         FUNCTION NBPUnload: OSErr;
  754.     {$ENDC}
  755.  
  756.     {$ALIGN RESET}
  757.     {$POP}
  758.     
  759.     {$SETC UsingIncludes := AppleTalkIncludes}
  760.  
  761. {$ENDC} (*__APPLETALK__*)
  762.  
  763. {$IFC NOT UsingIncludes}
  764.     END.
  765. {$ENDC}
  766.